load("//tools/build_defs/android:fb_xplat_android_cxx_library.bzl", "fb_xplat_android_cxx_library")
load("//tools/build_defs/oss:profilo_defs.bzl", "profilo_path")

fb_xplat_android_cxx_library(
    name = "hooks",
    srcs = [
        "hooks.cpp",
    ],
    headers = [
        "hooks.h",
    ],
    header_namespace = "profilo/util",
    exported_headers = [
        "hooks.h",
    ],
    compiler_flags = [
        "-fexceptions",
        "-frtti",
        "-std=gnu++14",
        "-Wall",
    ],
    force_static = True,
    labels = [],
    visibility = [
        profilo_path("cpp/..."),
        profilo_path("facebook/cpp/..."),
    ],
    deps = [
        profilo_path("deps/plthooks:plthooks"),
        profilo_path("deps/linker:linker"),
    ],
)

fb_xplat_android_cxx_library(
    name = "util",
    srcs = [
        "ProcFsUtils.cpp",
        "common.cpp",
    ],
    header_namespace = "profilo/util",
    exported_headers = [
        "ProcFsUtils.h",
        "common.h",
    ],
    compiler_flags = [
        "-fexceptions",
        "-frtti",
        "-fPIC",
        "-std=gnu++14",
        "-DLOG_TAG=\"Profilo/util\"",
        "-O3",
    ],
    labels = [],
    soname = "libprofilo_util.$(ext)",
    visibility = [
        "PUBLIC",
    ],
    deps = [
        profilo_path("deps/fb:fb"),
    ],
)
